|
|
|
|
|
|
|
By pressing F8 to run the program |
|
|
|
|
|
|
|
|
Examples Filename: Debug1.frm |
|
|
|
|
| Stepping Through Your Code 1. Select Tools, Options from the Visual Basic menu. 2. Select the Project tab from the Options window. 3. Select the frmDebug1 as the startup form. 4. Click the OK button. 5. Press F8 to begin the process. You should see a code window that looks like the one shown in Figure 16.2. 6. Press F8 to execute the next line of code. Continue to press F8 to execute each subsequent line of code. 7. When you get to a point where a form is displayed, you wont see any more code. | | | | |
|
|
|
|
Figure 16.2
The frmDebug1 form showing a global variable. |
|
|
|
|  | You will use the F8 key quite often as you debug your application. |
|
 |
|
|
|
|
NOTE When a form is displayed, your code is no longer running. Instead, Visual Basic is just waiting for an event to happen. If you click one of the controls in which you have written code, you will be placed into break mode after you click. |
|
|
|
|
|
|
|
|
Now that you know how to start a program in break mode, lets look at all the different things you can do while in break mode. |
|
|
|
|
|